fix(init): flash init show usage menu when called without arguments#235
fix(init): flash init show usage menu when called without arguments#235
flash init show usage menu when called without arguments#235Conversation
There was a problem hiding this comment.
Pull request overview
Updates the flash init CLI behavior so invoking it without a project argument shows a usage/help panel and exits, making “initialize in current directory” an explicit flash init ..
Changes:
- Added an early-exit usage panel for
flash initwhen called with no positional argument. - Updated init logic so only
flash init .initializes the current directory (no longer the default when omitted). - Added/updated unit tests to cover the new no-args behavior (exit code, no skeleton creation, usage output).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/runpod_flash/cli/commands/init.py |
Adds no-args usage panel + exit and adjusts current-directory branching to require .. |
tests/unit/cli/commands/test_init.py |
Adds tests validating no-args exit behavior, output, and that no skeleton is created. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
flash init show usage menu when called without arguments
runpod-Henrik
left a comment
There was a problem hiding this comment.
Code Review — PR #235: flash init usage menu
The init.py change is clean — showing usage panel when no args instead of silently initializing in cwd is good UX.
Note: This PR shares a large diff overlap with PRs #221 and #237 (aiohttp session consolidation, api_key_context.py removal, DEFAULT_WORKERS_MIN change, get_api_key() migration). The bugs found in those shared components apply here too:
- HIGH —
Authorizationheader sent to presigned S3 URLs inapp.py(see PR #221 review) - HIGH — Per-request API key propagation from LB to workers silently removed (see PR #221 review)
- HIGH —
uv pip installfails without active venv inupdate.py(see PR #237 review, ifupdate.pyis included)
The init.py change itself has no issues. Tests cover all three modes (flash init, flash init ., flash init name).
dfd74ae to
e57fdf5
Compare
e57fdf5 to
4a049e3
Compare
Previously `flash init` with no arguments silently initialized in the current directory (same as `flash init .`). Now it shows a usage panel with examples and exits, matching expected CLI behavior: - `flash init` prints usage menu - `flash init .` initializes in current directory - `flash init <name>` creates new project folder
Replace hand-crafted usage text with ctx.get_help() to prevent drift when CLI options change. Update argument help text to clarify that '.' must be explicitly passed for current-directory init.
4a049e3 to
cf88808
Compare
Summary
flash initwith no arguments now shows a usage panel with examples and exits instead of silently initializing in the current directoryflash init .continues to initialize in the current directory (unchanged)flash init <name>continues to create a new project folder (unchanged)Before:
flash initandflash init .had identical behavior -- both initialized in cwd.After:
flash initshows usage menu;flash init .is the explicit way to initialize in cwd.Test plan
Nonecreates skeleton (removed -- behavior changed)make quality-checkpasses (1261 tests, 73.75% coverage)flash init,flash init .,flash init <name>